package com.chen.demo.rhombus.ohs.local.appservice.impl;

import com.chen.demo.rhombus.domain.vo.UserVo;
import com.chen.demo.rhombus.ohs.local.appservice.UserAppService;
import com.chen.demo.rhombus.ohs.local.pl.command.UserAddCommand;
import com.chen.demo.rhombus.ohs.local.pl.executor.UserAddCmdExe;
import com.chen.demo.rhombus.ohs.local.pl.command.query.UserPageQuery;
import com.chen.demo.rhombus.ohs.local.pl.executor.UserPageQryExe;
import com.chen.winnerframework.http.response.PageResponse;
import com.chen.winnerframework.http.response.Response;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class UserAppServiceImpl implements UserAppService {

    private final UserAddCmdExe userAddCommandHandler;
    private final UserPageQryExe userPageQueryHandler;

    @Override
    public Response addUser(UserAddCommand command) {
        return userAddCommandHandler.execute(command);
    }

    @Override
    public PageResponse<UserVo> pageQueryUser(UserPageQuery pageQuery) {
        return userPageQueryHandler.execute(pageQuery);
    }

}
